<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="false" %>

<script>
function pay() {
	var fm = document.payForm;
	
	var bill_select = $("input[name='bill_select']:checked");
    if( bill_select.length <= 0 ){
	    alert("결제방법을 선택하세요.");
	    return;
    }
    $("#LGD_CUSTOM_FIRSTPAY").val( fm.bill_select.value );
    
    
    //주문번호 생성
    var ordNo = "";
    ordNo = fnHashData();
    $("#LGD_OID").val(ordNo);
    
    //결제진행
    doPay_ActiveX();
}

function fnHashData() {
    var ordno = "000";
    $.ajax({
        type: "POST",
        url: "orderNoAjax.vh",
        async : false,
        success: function(data) {
          ordno = $.trim(data.ordno);
      }
    });
    return ordno;
}

function doPay_ActiveX() {
	$("#payForm").attr("action","startPG.vh");
	$("#payForm").submit();
}
</script>

<!-- 콘텐츠 영역 -->
	<div id="BodyWrap">
        <section>
            <h4 class="pag_title" title="주문/결제하기">주문/결제하기</h4>
            <form name="payForm" id="payForm" method="post">
            	<input type="hidden" name="LGD_OID" id="LGD_OID" value="" />			<!-- 주문번호  -->
            	<input type="hidden" name="LGD_BUYER" id="LGD_BUYER" value="홍길동" />			<!-- 결제금액  -->
            	<input type="hidden" name="LGD_PRODUCTINFO" id="LGD_PRODUCTINFO" value="myLG070-인터넷전화기"/>			<!-- 결제금액  -->
            	<input type="hidden" name="LGD_AMOUNT" id="LGD_AMOUNT" value="100"/>			<!-- 결제금액  -->
            	<input type="hidden" name="LGD_BUYEREMAIL" id="LGD_BUYEREMAIL" value="test@vhmall.co.kr"/>			<!-- 구매자 이메일  -->
            	<input type="hidden" name="LGD_TIMESTAMP" id="LGD_TIMESTAMP" value="1234567890"/>			<!-- 타임스탬프  -->
            	<input type="hidden" name="LGD_CUSTOM_FIRSTPAY" id="LGD_CUSTOM_FIRSTPAY" value=""/>			<!-- 초기결제수단  -->
            
            <div id="ContentWrap4">
            	<ul class="showwindow_list4">
            		<c:forEach items="${requestScope.itemList}" var="items" varStatus="status">
	                	<li>
	                    	<a href="${contextPath}/vhmall/item_detail.vh?prdcd=${items.PRDCD}" class="thumb">
	                            <img src="http://www.vhmall.co.kr/inc/imgLoad.jsp?dirName=product/${items.CORPNO}/&fileName=${items.PRDIMG1_ENC}&thumb=Y&quality=100&size=230" />
	                        </a>
	                        <div class="windowinfo_area">
	                        	<a href="#" class="title">${items.PRDNM }</a>
	                            <p class="price">
	                                <span class="discount"><em>${items.SELPRC}</em>원</span>
	                                ${items.CPNPRC}원
	                            </p>
	                        </div>
	                    </li>
	               </c:forEach>
                </ul>
                <section>
                	<h5 class="hidtext" title="주문/결제관련 입력">주문/결제관련 입력</h5>
                    <div class="item_buytitarea" title="결제정보">결제정보</div>
                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="item_callist" summary="결제금액 산출내역">
                    	<colgroup>
                        <col style="width:33%">
                        <col style="width:67%">
                        </colgroup>
                        <tr>
                        	<th>주문금액</th>
                            <td><span class="dinmed">45,000</span>원</td>
                        </tr>
                        <tr>
                        	<th>할인금액</th>
                            <td><span class="dinmed">-5,000</span>원</td>
                        </tr>
                        <tr>
                        	<th>배송비</th>
                            <td><span class="dinmed">-3,000</span>원</td>
                        </tr>
                        <tr>
                        	<th class="ftc_red">총 결제금액</th>
                            <td><span class="dinmed credit_price">35,000</span>원</td>
                        </tr>
                    </table>
                    <div class="item_buytitarea" title="구매자 정보">구매자 정보
                    	<a href="#" class="btn_blostyle1 gradation_white2" title="보내시는 분 수정">보내시는 분 수정</a>
                    </div>
                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="item_callist" summary="구매자 정보내역">
                    	<colgroup>
                        <col style="width:33%">
                        <col style="width:67%">
                        </colgroup>
                        <tr>
                        	<th>이름</th>
                            <td class="ta_l">홍길동</td>
                        </tr>
                        <tr>
                        	<th>휴대폰</th>
                            <td class="ta_l">010-5214-2141</td>
                        </tr>
                        <tr>
                        	<th>이메일</th>
                            <td class="ta_l">kildonghong@naver.com</td>
                        </tr>
                    </table>
                    <!-- 비회원 주문 -->
                    <div class="item_buytitarea" title="구매자 정보">구매자 정보
                    	<a href="#" class="btn_blostyle1 gradation_white2" title="보내시는 분 수정">보내시는 분 수정</a>
                    </div>
                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="item_callist" summary="구매자 정보내역">
                    	<colgroup>
                        <col style="width:33%">
                        <col style="width:67%">
                        </colgroup>
                        <tr>
                        	<th>이름</th>
                            <td class="ta_l">홍길동</td>
                        </tr>
                        <tr>
                        	<th>휴대폰</th>
                            <td class="ta_l">010-5214-2141</td>
                        </tr>
                        <tr>
                        	<th>주소</th>
                            <td class="ta_l">
                            	<p class="zipcode"><input type="number" name="textfield3" id="textfield3" class="inpt_wauto" style="width:42px;" value="480" maxlength="3">
                                	-
                                	<input type="number" name="textfield4" id="textfield4" class="inpt_wauto" style="width:42px;" value="252" maxlength="3">
                                	<a href="#" class="btninli_blk" style="font-size:0.67em; letter-spacing:-0.05em;" title="우편번호찾기"><span class="btn_ins">우편번호찾기</span></a>
                                </p>
                                <div class="inpser_box bgbocol_gray mar_b5">
                                    <p>
                                        <input type="text" name="textfield3" id="textfield3" placeholder="">
                                    </p>
                                	<a href="#" class="btn_delsi1" title="삭제">×</a>
                                </div>
                                <div class="inpser_box bgbocol_gray">
                                    <p>
                                        <input type="text" name="textfield3" id="textfield3" placeholder="">
                                    </p>
                                	<a href="#" class="btn_delsi1" title="삭제">×</a>
                                </div>
                            </td>
                        </tr>
                        <tr>
                        	<th>배송메시지</th>
                            <td class="ta_l">
                            	  <textarea name="textarea" id="textarea" class="txtaa_wauto1"></textarea>
                            	  <p class="page_tea">0/100</p>
                          </td>
                        </tr>
                        <tr>
                        	<th>이메일</th>
                            <td class="ta_l">
								<div class="inpser_box bgbocol_gray">
                                    <p>
                                        <input type="text" name="textfield3" id="textfield3" placeholder="">
                                    </p>
                                	<a href="#" class="btn_delsi1" title="삭제">×</a>
                                </div>
                            </td>
                        </tr>
                    </table>
                    <!--// 비회원 주문 -->
                    <div class="item_buytitarea" title="받는사람 정보">받는사람 정보</div>
                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="item_callist" summary="받는사람 정보 입력목록">
                    	<colgroup>
                        <col style="width:33%">
                        <col style="width:67%">
                        </colgroup>
                        <tr>
                        	<td colspan="2" class="bgc_gray">
                            	<div class="tac_sel">
                                    <input type="radio" name="delivery_select" id="delivery_se1" value="1">
                                    <label for="delivery_se1">주문자와 동일</label>
                                    <input type="radio" name="delivery_select" id="delivery_se2" value="2">
                                    <label for="delivery_se2">신규주소</label>
                                    <input type="radio" name="delivery_select" id="delivery_se3" value="3">
                                    <label for="delivery_se3">과거배송지</label>
                                </div>
                            </td>
                        </tr>
                        <tr>
                        	<th>이름</th>
                            <td class="ta_l">
                            	<div class="inpser_box bgbocol_gray">
                                    <p>
                                        <input type="text" name="textfield3" id="textfield3" value="홍길동">
                                    </p>
                                	<a href="#" class="btn_delsi1" title="삭제">×</a>
                                </div>
                            </td>
                        </tr>
                        <tr>
                        	<th>휴대폰</th>
                            <td class="ta_l">
								<div class="inpser_box bgbocol_gray">
                                    <p>
                                        <input type="text" name="textfield2" id="textfield2" value="010-5214-2141">
                                    </p>
                                	<a href="#" class="btn_delsi1" title="삭제">×</a>
                                </div>
                            </td>
                        </tr>
                        <tr>
                        	<th>주소</th>
                            <td class="ta_l">
                            	<p class="zipcode"><input type="number" name="textfield3" id="textfield3" class="inpt_wauto" style="width:45px;" value="480" maxlength="3">
                                	-
                                	<input type="number" name="textfield4" id="textfield4" class="inpt_wauto" style="width:45px;" value="252" maxlength="3">
                                	<a href="#" class="btninli_blk" title="우편번호찾기"><span class="btn_ins">우편번호찾기</span></a>
                                </p>
                                <div class="inpser_box bgbocol_gray mar_b5">
                                    <p>
                                        <input type="text" name="textfield3" id="textfield3" value="서울특별시 강남구 대치2동 1002 KT&amp;G타워">
                                    </p>
                                	<a href="#" class="btn_delsi1" title="삭제">×</a>
                                </div>
                                <div class="inpser_box bgbocol_gray">
                                    <p>
                                        <input type="text" name="textfield3" id="textfield3" value="509호">
                                    </p>
                                	<a href="#" class="btn_delsi1" title="삭제">×</a>
                                </div>
                            </td>
                        </tr>
                        <tr>
                        	<th>배송메시지</th>
                            <td class="ta_l">
                            	  <textarea name="textarea" id="textarea" class="txtaa_wauto1"></textarea>
                            	  <p class="page_tea">0/100</p>
                          </td>
                        </tr>
                    </table>
                    <div class="item_buytitarea" title="결제방법">결제방법</div>
                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="item_callist" summary="결제방법 선택 및 입력">
                    	<colgroup>
                        <col>
                        </colgroup>
                        <tr>
                        	<td class="bgc_gray">
                            	<div class="tac_sel">
                                    <input type="radio" name="bill_select" id="bill_se1" value="SC0060">
                                    <label for="bill_se1">휴대폰</label>
                                    <input type="radio" name="bill_select" id="bill_se2" value="SC0010">
                                    <label for="bill_se2">신용카드</label>
                                    <input type="radio" name="bill_select" id="bill_se3" value="SC0040">
                                    <label for="bill_se3">무통장입금</label>
                                </div>
                            </td>
                        </tr>
                        <td class="ta_l">
                        	<div class="catitle">입금은행</div>
                            <div class="mar_b12"><select name="select" id="select" class="item_option">
                                    <option>은행을 선택하세요.</option>
                                    <option>국민은행</option>
                                    <option>농협</option>
                                    <option>기업은행</option>
                                    <option>산업은행</option>
                                    <option>신한은행</option>
                                    <option>우리은행</option>
                                </select>
                            </div>
                            <div class="catitle">현금영수증</div>
                            <div class="cainve">
                            	<p>
                                	<input type="radio" name="receipt_select" id="receipt_se1" value="1">
                                    <label for="receipt_se1">개인소득공제용</label>
                                    <input type="radio" name="receipt_select" id="receipt_se2" value="2">
                                    <label for="receipt_se2">사업자증빙용</label>
                                    <input type="radio" name="receipt_select" id="receipt_se3" value="3">
                                    <label for="receipt_se3">신청안함</label>
                                </p>
                                <p>
                                	<select name="select" id="select" class="item_option">
                                        <option>발급방법을 선택하세요.</option>
                                        <option>휴대폰번호</option>
                                        <option>주민등록번호</option>
                                        <option>카드번호</option>
                                    </select>
                                </p>
                                <div class="inpser_box bgbocol_gray mar_b3">
                                    <p>
                                        <input type="text" name="textfield3" id="textfield3"  placeholder="'-'제외하고 입력해주세요.">
                                    </p>
                                	<a href="#" class="btn_delsi1" title="삭제">×</a>
                                </div>
                                <p class="smatx">무통장입금 완료 후 2일 이내 현금영수증이 발급됩니다.</p>
                            </div>
                        </td>
                    </table>
                    <!-- 약관 동의 -->
                    <div class="item_buytitarea" title="회원가입 약관 동의">회원가입 약관 동의
                    	<div class="agr_chk">
                            <div class="inp_ckb">
                                <input type="checkbox" class="ckb" name="checkbox" id="agree_check">
                                <label for="agree_check">모두동의</label>
                            </div>
                        </div>
                    </div>
                    <!-- 약관동의는 비회원일때는 비회원개인정보, 주문동의서 회원일때는 주문동의서만 노출 -->
                    <ul class="agree_cks">
                    	<li>
                        	<div class="shtit1">
                            	<div class="inp_ckb2 f_l">
                                    <input type="checkbox" class="ckb" name="checkbox" id="checkbox1">
                                    <label for="checkbox1">&nbsp;</label>
								</div>
								<p>비회원 개인정보보호 동의<span class="fts_s1 ftc_red">(필수)</span></p>
                            	<div class="btn_aghc">
                                    <a href="#" class="open">펼처보기</a>
                                </div>
                            </div>
                        </li>
                        <li class="sh_agre" style="display:block;">
                        	<div>
                          		약관동의
                            </div>
                        </li>
                        <li class="sh_agre">
                        	<div>
                          		약관동의
                            </div>
                        </li>
                        <li>
                        	<div class="shtit1">
                            	<div class="inp_ckb2 f_l">
                                    <input type="checkbox" class="ckb" name="checkbox" id="checkbox1">
                                    <label for="checkbox1">&nbsp;</label>
								</div>
                            	<p>주문 동의서<span class="fts_s1 ftc_red">(필수)</span></p>
                            </div>
                        </li>
                        <li class="sh_agre2">
                        	<div>
                          		문구오류 (대체HTML로 변경해야할듯)
                            </div>
                        </li>
                    </ul>
                    <!--// 약관 동의 -->
                    <div class="btnposition_itembuy">
                    	<div class="btnwline1_red">
                        	<a href="javascript:pay();" class="gradation_red2" title="결제하기">결제하기</a>
                        </div>
                    </div>               
                </section>
            </div>
            </form>
        </section>
        <!--// 콘텐츠 영역 -->